package com.sdk.cachesdk.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Component
@ConfigurationProperties(prefix = "caffeine")
public class CaffeineProperties {
    private long expireAfterWrite = 1;
    private TimeUnit expireAfterWriteUnit = TimeUnit.HOURS;
    private int maximumSize = 10000;

    // getters and setters
    public long getExpireAfterWrite() {
        return expireAfterWrite;
    }

    public void setExpireAfterWrite(long expireAfterWrite) {
        this.expireAfterWrite = expireAfterWrite;
    }

    public TimeUnit getExpireAfterWriteUnit() {
        return expireAfterWriteUnit;
    }

    public void setExpireAfterWriteUnit(TimeUnit expireAfterWriteUnit) {
        this.expireAfterWriteUnit = expireAfterWriteUnit;
    }

    public int getMaximumSize() {
        return maximumSize;
    }

    public void setMaximumSize(int maximumSize) {
        this.maximumSize = maximumSize;
    }
}
